package org.breathe.thread.pool.common.entity;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.breathe.thread.pool.common.constant.BreatheDtpConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * 这个项目的配置信息
 * @author: breathe
 * @createTime: 2025-04-09
 */
@Slf4j
@Data
@ConfigurationProperties(prefix = BreatheDtpConstant.MAIN_PROPERTIES_PREFIX)
public class BreatheDtpProperties {
    /**
     * 如果愿意使用该项目
     */
    private boolean enabled = true;

    /**
     * 是否打印我的banner
     */
    private boolean enabledBanner = true;

    /**
     * 是否使用ai
     */
    private boolean enabledAi = false;

    /**
     * 是否能够收集指标
     */
    private boolean enabledCollect = false;

    /**
     * Metrics collector type.
     */
    public String collectorType = "logging";

    /**
     * 存储路径
     */
    public String logPath;

    /**
     * 监控间隔（s）
     */
    private int monitorInterval = 5;

    /**
     * nacos配置
     */
    private Nacos nacos;

    /**
     * Mysql配置
     */
    private Mysql mysql;

    /**
     * ai配置
     */
    private AiProperties ai;

    /**
     * 配置文件类型
     */
    private String configType = "yml";

    /**
     * end-point address
     */
    private List<String> endpointAddress = List.of("breathe-dynamic-tp");
    /**
     * 线程池配置
     */
    private List<ThreadPoolExecutorProperties> executors;

    /**
     * 报警平台
     */
    private List<NotifyPlatform> platforms;

    @Data
    public static class Nacos {
        private String dataId;
        private String group;
        private String namespace;
    }
    @Data
    public static class Mysql{
        private String tableName;
        private String columnName;
        private String configKey;
        private String configValue;
        private long refreshInterval = 5;
    }
}
